<template>
	<view>
		<swiper class="screen-swiper" :class="dotStyle?'square-dot':'round-dot'" :indicator-dots="true" :circular="true" :autoplay="true" interval="5000" duration="500">
			<swiper-item v-for="(item,index) in swiperList" :key="index" @tap="picClick(item.url)">
				<image :src="item.src" mode="aspectFill" v-if="item.type=='image'"></image>
				<video :src="item.src" autoplay loop muted :show-play-btn="false" :controls="false" objectFit="cover" v-if="item.type=='video'"></video>
			</swiper-item>
		</swiper>
		<button @tap="ttt">点击</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dotStyle:true,
				swiperList: [{
					id: 0,
					type: 'image',
					src:'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg',
					url: 'https://vdept.bdstatic.com/4b4378336d76436661347034696c6371/62656e7949696a5a/a75d1661d363e92e358466749d7cf22278df92a55c0d6a81cc22ac1c9aa1a9e30d3b42e47c3a3ea69257932852411e14.mp4?auth_key=1583478845-0-0-819029c5f4d303e5dca322841f449f66'
				}, {
					id: 1,
					type: 'image',
					src: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big37006.jpg',
					url:''
				}, {
					id: 2,
					type: 'image',
					src: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big39000.jpg',
					url:''
				}, {
					id: 3,
					type: 'image',
					src: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg',
					url:''
				}, {
					id: 4,
					type: 'image',
					src: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25011.jpg',
					url:''
				}, {
					id: 5,
					type: 'image',
					src: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big21016.jpg',
					url:''
				}, {
					id: 6,
					type: 'image',
					src: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg',
					url:''
				}],
				
			};
		},
		methods:{
			picClick(url){
				console.log(url,8888);
			},
			ttt(){
				uniCloud.callFunction({
				    name: 'test',
				    data: { a: 1 , b:2},
				    success(res){
							console.log('调用云函数');
							console.log(res.result);
							
						},
				    fail(){},
				    complete(){}
				});
			}
		}
		
	}
</script>

<style lang="scss">

</style>